﻿@model IEnumerable<FollowPeers.Models.Message>

@{
    ViewBag.Title = "Messages > Inbox";
}

@Html.Partial("_Header")

<div class="container" id="main">
<div class="row">
@Html.Partial("_MessageSideBar")
    <div style="margin-left:10px">
        <table style="margin:5px 0px 5px 0px">
        @{
            if (!Model.Any(m => m.Reciever == ViewBag.UserName))
            {
                <tr>
                    <td>You have no messages in your inbox. You can send a message by clicking the button on the left or check your trash.
                     </td>
                </tr>   
            }
            else
            {
                foreach (var item in Model)
                {
                    <tr >
                        <td>
                            <div class="MessageContainer">
                               <img src="../../Content/TempImages/default.jpg" style="width:10%; height:48px; padding:5px 2px 5px 2px; display:inline-block; float:left;"/>
                                <div class="messageDetails" style="width:73%;height:40px; float:left; padding: 5px 0px 0px 10px;">
                                    <div class="messageName"> @Html.ActionLink(item.Sender, "Details", new { id = item.MessageId })</div>
                                    <div class="messageSubject">@Html.Label(item.Subject)</div>
                                </div>
                                <div class="MessageOptions" style="width:15%; float:right; display:inline-block;">
                                    @Html.ActionLink("star", "Star", new { id = item.MessageId }) |
                                    @Html.ActionLink("trash", "Trash", new { id = item.MessageId })
                                </div>
                            </div>
                        </td>
                    </tr>
                }
            }
       }
        </table>
    </div>
    </div>
</div>

@Html.Partial("_Footer")